package com.jingdianjichi.circle.server.config.sensitive;

import com.jingdianjichi.circle.server.sensitive.WordContext;
import com.jingdianjichi.circle.server.sensitive.WordFilter;
import com.jingdianjichi.circle.server.sevice.SensitiveWordsService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 敏感词过滤器的配置类
 */
@Configuration
public class SensitiveConfig {

    //配置是否要做定时刷新
    @Bean
    public WordContext wordContext(SensitiveWordsService service) {
        return new WordContext(true, service);
    }


    //提那家我们的敏感词过滤器
    @Bean
    public WordFilter wordFilter(WordContext wordContext) {
        return new WordFilter(wordContext);
    }

}
